
from flask_login import current_user
from flask_restful import Resource, marshal_with  # type: ignore
from controllers.console import api
from libs.login import login_required
from fields.timbre_fields_def import base_timbre_fields
from services.robot.timbre_service import TimbreService
class RobotTimbresApi(Resource):

    @login_required
    @marshal_with(base_timbre_fields)
    def get(self):
        timbres = TimbreService.get_timbres(current_user.current_tenant_id)
        return timbres
    
api.add_resource(RobotTimbresApi, "/timbres")